package com.qidian.by.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * <p>
 * 
 * </p>
 *
 * @author 小可怎么都睡不够
 * @since 2024-05-06
 */
@TableName("buy_content_category")
public class ContentCategory implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 内容类别编号
     */
    @TableId(value = "cat_id", type = IdType.AUTO)
    private Long catId;


    /**
     * 内容类别名称
     */
    private String catName;

    /**
     * 内容类别说明
     */
    private String catDesc;

    /**
     * 内容类别的父类别编号，如果是一级类目，则为0
     */
    private Long parentId;

    /**
     * 标记是否是父级类目
     */
    private Integer parent;

    /**
     * 类别标记,自定义的标记，不能重复
     */
    private String catMark;

    /**
     * 内容类别创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 内容类别最后修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modifyTime;

    /**
     * 内容类别状态 1 正常 2 禁用
     */
    @TableField(value = "status")
    @TableLogic(value = "1", delval = "99")
    private Integer status;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ContentCategory that = (ContentCategory) o;
        return Objects.equals(catId, that.catId) && Objects.equals(catName, that.catName) && Objects.equals(catDesc, that.catDesc) && Objects.equals(parentId, that.parentId) && Objects.equals(parent, that.parent) && Objects.equals(catMark, that.catMark) && Objects.equals(createTime, that.createTime) && Objects.equals(modifyTime, that.modifyTime) && Objects.equals(status, that.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(catId, catName, catDesc, parentId, parent, catMark, createTime, modifyTime, status);
    }

    public Long getCatId() {
        return catId;
    }

    public void setCatId(Long catId) {
        this.catId = catId;
    }

    public String getCatName() {
        return catName;
    }

    public void setCatName(String catName) {
        this.catName = catName;
    }

    public String getCatDesc() {
        return catDesc;
    }

    public void setCatDesc(String catDesc) {
        this.catDesc = catDesc;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getParent() {
        return parent;
    }

    public void setParent(Integer parent) {
        this.parent = parent;
    }

    public String getCatMark() {
        return catMark;
    }

    public void setCatMark(String catMark) {
        this.catMark = catMark;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(LocalDateTime modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "ContentCategory{" +
            "catId = " + catId +
            ", catName = " + catName +
            ", catDesc = " + catDesc +
            ", parentId = " + parentId +
            ", parent = " + parent +
            ", catMark = " + catMark +
            ", createTime = " + createTime +
            ", modifyTime = " + modifyTime +
            ", status = " + status +
        "}";
    }
}
